home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Dream Studio
/
Ray Dream Studio (CDRAYD1) (Ray Dream) (1995).iso
/
DREAMSDK.WIN
/
INCLUDE
/
I3DSHOBJ.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-18
|
12KB
|
251 lines
/* $Id: I3DSHOBJ.H 1.3 1995/10/06 21:14:17 YannPC Exp $ */
/*****************************************************************************\
* *
* I3DShObj.h *
* I3DShObject *
* I3DShPrimitive *
* I3DShPolygonList *
* I3DShPolygonArray *
* I3DShPatchArray *
* I3DShFlatSurface *
* *
* Copyright (c) 1995, Ray Dream, Inc. All rights reserved. *
* *
\*****************************************************************************/
#ifndef __I3DSHOBJ__
#define __I3DSHOBJ__
#ifndef __3DCOTYPE__
#include "3DCoType.h"
#endif
//****** Globally Unique Ids **************************************************
DEFINE_GUID(IID_I3DShObject, 0xBDEA68A0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(IID_I3DShPrimitive, 0x5C9601A7L, 0x7CC3, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(IID_I3DShPolygonList, 0xBFBEDA80L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(IID_I3DShPolygonArray, 0xC1840A20L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(IID_I3DShPatchArray, 0xC361A3C0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(IID_I3DShFlatSurface, 0xC546DE80L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
//-- The following classes are available in Ray Dream Designer:
DEFINE_GUID(CLSID_StandardPolygonList, 0xC756D2C0L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(CLSID_StandardPolygonArray, 0xCA395940L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(CLSID_StandardPatchArray, 0xCBF56120L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
DEFINE_GUID(CLSID_StandardFlatSurface, 0xCDC9D300L, 0x3A02, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
struct ShadingShape;
class I3DShShader;
/*****************************************************************************\
* I3DShObject *
* *
* I3DShObject contain the geometry and shading information of the objects *
* in a scene. *
* They are kept in a list in the scene (the Objects List), and can be *
* instanciated as many times as needed in a scene. * *
* *
* There are two types of Objects: Primitives and Scenes (a Scene can be *
* instanciated in another Scene). See I3DShPrimitive and I3DShScene. *
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShObject
DECLARE_INTERFACE_(I3DShObject, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShObject methods
//-- Naming
STDMETHOD(SetName) (THIS_ char* name) PURE;
STDMETHOD(GetName) (THIS_ char* name) PURE;
//-- Shading calls
STDMETHOD(SetSimpleShading) (THIS_ COLOR3D* color, NUM3D specularIntensity, NUM3D specularIndex, NUM3D reflection, NUM3D transparency) PURE;
STDMETHOD(SetPrimerShader) (THIS_ I3DShShader* primerShader) PURE;
STDMETHOD_(ULONG, GetUVSpaceCount) (THIS) PURE;
STDMETHOD(GetUVSpace) (THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo) PURE;
STDMETHOD(AddShadingShape) (THIS_ ShadingShape* shadingShape, ULONG uvSpaceID) PURE;
};
/*****************************************************************************\
* I3DShPrimitive *
* *
* A Primitive is a simple geometric Object: sphere, polygon list, etc. *
* Other interfaces supported: I3DShObject *
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShPrimitive
DECLARE_INTERFACE_(I3DShPrimitive, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShPrimitive methods
//-- Geometry calls
STDMETHOD_(BOOLEAN, IsPatchBased) (THIS) PURE;
STDMETHOD(EnumPatches) (THIS_ EnumPatchesCallback callback, void* privData) PURE;
STDMETHOD(EnumFacets) (THIS_ EnumFacetsCallback callback, void* privData) PURE;
};
/*****************************************************************************\
* I3DShPolygonList *
* *
* I3DShPolygonList is simply a bag of triangular facets. *
* Other interfaces supported: I3DShObject, I3DShPrimitive *
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShPolygonList
DECLARE_INTERFACE_(I3DShPolygonList, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShPolygonList methods
//-- Init calls
STDMETHOD(Init) (THIS_ BOOLEAN hasNormals, BOOLEAN hasUV) PURE;
STDMETHOD(SetUVSpace) (THIS_ VECTOR2D* minUV, VECTOR2D* maxUV) PURE; // Call this if hasUV is true
//-- Facets handling
STDMETHOD(PreAllocateFacets) (THIS_ ULONG nbFacets) PURE; // Use this if you know in advance how many facets you will build
STDMETHOD(AddFacet) (THIS_ FACET3D* facet) PURE;
STDMETHOD_(ULONG, CountFacets) (THIS) PURE;
STDMETHOD(CalcNormals) (THIS_ NUM3D smoothAngle) PURE; // Use this call if you do not know how to make the normals
};
/*****************************************************************************\
* I3DShPolygonArray *
* *
* I3DShPolygonArray is a regular array of 3D points and normals. *
* Other interfaces supported: I3DShObject, I3DShPrimitive *
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShPolygonArray
DECLARE_INTERFACE_(I3DShPolygonArray, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShPolygonArray methods
//-- Init calls
STDMETHOD(Init) (THIS_ ULONG uCount, ULONG vCount, BOOLEAN uClosed, BOOLEAN vClosed) PURE;
//-- Geometry calls
STDMETHOD(SetVertex) (THIS_ ULONG uIndex, ULONG vIndex, VECTOR3D* vertex, VECTOR3D* normal) PURE; // normal can be NULL
STDMETHOD(GetVertex) (THIS_ ULONG uIndex, ULONG vIndex, VECTOR3D* vertex, VECTOR3D* normal) PURE; // normal can be NULL
//-- (u,v) calls
STDMETHOD(MeshSetU) (THIS_ ULONG uIndex, NUM3D uValue) PURE;
STDMETHOD(MeshSetV) (THIS_ ULONG vIndex, NUM3D vValue) PURE;
STDMETHOD(MeshGetU) (THIS_ ULONG uIndex, NUM3D* uValue) PURE;
STDMETHOD(MeshGetV) (THIS_ ULONG vIndex, NUM3D* vValue) PURE;
//-- Goodies
STDMETHOD(CalcUV) (THIS) PURE; // Calculate for you all (u,v) values if you do not know how to make them
STDMETHOD(CalcNormals) (THIS_ BOOLEAN smooth) PURE; // Calculate for you all normals if you do not know how to make them
};
/*****************************************************************************\
* I3DShPatchArray *
* *
* I3DShPatchArray is an array of cubic 4 x 4 Bezier patches. *
* Other interfaces supported: I3DShObject, I3DShPrimitive *
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShPatchArray
DECLARE_INTERFACE_(I3DShPatchArray, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShPatchArray methods
//-- Init calls
STDMETHOD(Init) (THIS_ ULONG uCount, ULONG vCount) PURE;
//-- Geometry calls
STDMETHOD(SetPatch) (THIS_ ULONG uIndex, ULONG vIndex, PATCH3D* patch) PURE;
STDMETHOD(GetPatch) (THIS_ ULONG uIndex, ULONG vIndex, PATCH3D* patch) PURE;
//-- (u,v) calls
STDMETHOD(MeshSetU) (THIS_ ULONG uIndex, NUM3D uValue) PURE;
STDMETHOD(MeshSetV) (THIS_ ULONG vIndex, NUM3D vValue) PURE;
STDMETHOD(MeshGetU) (THIS_ ULONG uIndex, NUM3D* uValue) PURE;
STDMETHOD(MeshGetV) (THIS_ ULONG vIndex, NUM3D* vValue) PURE;
//-- Goodies
STDMETHOD(CalcUV) (THIS) PURE; // Calculate for you all (u,v) values if you do not know how to make them
};
/*****************************************************************************\
* I3DShFlatSurface *
* *
* I3DShFlatSurface is a flat object made of curves and polygons *
* Other interfaces supported: I3DShObject, I3DShPrimitive *
* *
* Pseudo "grammar" for building 2D curves:
* FLATSURFACE =
* BeginFlatSurface
* GROUP
* EndFlatSurface
*
* GROUP =
* BeginGroup
* GROUP | COMPOUND | PATH 1 or more times
* EndGroup
*
* COMPOUND =
* BeginCmpnd
* GROUP | COMPOUND | PATH 1 or more times
* EndCmpnd
*
* PATH =
* BeginPath
* LineTo | BezierTo 1 or more times
* EndPath
* *
\*****************************************************************************/
#undef INTERFACE
#define INTERFACE I3DShFlatSurface
DECLARE_INTERFACE_(I3DShFlatSurface, IUnknown) {
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
// I3DShFlatSurface methods
//-- Geometry building calls (see grammar above)
STDMETHOD(BeginFlatSurface) (THIS) PURE; // Call this before building the surface
STDMETHOD(EndFlatSurface) (THIS) PURE; // And this when you are done
STDMETHOD(BeginGroup) (THIS) PURE;
STDMETHOD(EndGroup) (THIS) PURE;
STDMETHOD(BeginCmpnd) (THIS) PURE; // Use compounds to make holes
STDMETHOD(EndCmpnd) (THIS) PURE;
STDMETHOD(BeginPath) (THIS_ VECTOR2D* firstPoint) PURE;
STDMETHOD(LineTo) (THIS_ VECTOR2D* secondPoint) PURE;
STDMETHOD(BezierTo) (THIS_ VECTOR2D* secondPoint, VECTOR2D* thirdPoint, VECTOR2D* fourthPoint) PURE;
STDMETHOD(EndPath) (THIS) PURE;
};
#endif